package com.csii.activiti.server.api.config;

import com.csii.activiti.server.api.vo.Result;
import com.csii.activiti.server.core.exception.RequestParamException;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
@Slf4j
public class ExceptionHandlerConfig {
    /**
     * 处理自定义异常
     */
    @ExceptionHandler(RequestParamException.class)
    public Result<?> handleRRException(RequestParamException e){
        log.error(e.getMessage(), e);
        return Result.error(e.getMessage());
    }
}
